import proFetch from 'src/hrpub/common/utils/project-fetch';
import { getAppPageConfig } from 'src/hrpub/common/utils/utils';
const { appcode, pagecode } = getAppPageConfig();
const path = '/nccloud/hrtrn/handover/';
export default {
	name: 'transEntry',
	data: {
		appcode,
		pagecode,
		widget: false,
		pageInfo: {
			pageIndex: 1,
			pageSize: 10,
			total: 0,
			totalPage: 1
		},
		pagiType: '1', // 1 入职  2 离职
		showMode: 'list-browse',
		tabIndex: '1',
		hrorgobj: {},
		lang: {},
		searchData: {},
		hasListData: false
	},
	sync: {
		update(state, payload) {
			return {
				...state,
				...payload
			};
		}
	},
	async: {
		/* 获取列表数据 */
		getTableData(dispatch, getState, payload) {
			return proFetch({
				url: `${path}HandoversQueryAction.do`,
				body: payload.postData
			});
		},
		/* 获取详情页数据 */
		getDetailData(dispatch, getState, payload) {
			return proFetch({
				url: `${path}HandoverDetailAction.do`,
				body: payload.postData
			});
		},
		/* 审批功能 */
		sendApprove(dispatch, getState, payload) {
			return proFetch({
				url: `${path}HandoverApproveAction.do`,
				body: payload.postData
			});
		},
		//小部件跳转接口
        getWidgetTableData(dispatch,getState,payload){
            return proFetch({
                url: '/nccloud/hrtrn/widgets/ListData.do',
                body: payload.postData
            })
        }
	}
};
